table.insert(itemActions,
	function(item, action)
		-- RARE belts v1.0b - 07.24.08
		-- By Kel, using existing AO and PR functions/code not created by me.
		-- see: dir .. "readme.txt" for information regarding these variables
		local priority = 6
		local identify = true
		local dump = true

		if not (item.quality == ItemQuality.Rare and item.baseItem.baseType.Type == ItemKind.Belt) then
			return false
		elseif action == aPICK and (not item.flags.Identified or isGoodRareBelt(item)) then
			return priority
		elseif action == aIDENT then
			return identify
		elseif action == aSELL and item.flags.Identified and not isGoodRareBelt(item) then
			return true
		elseif action == aDUMP and item.flags.Identified and not isGoodRareBelt(item) then
			return dump
		end

		return false
	end
)

function isGoodRareBelt(item)
	local fhr, str, life, regen = false, false, false, false
	local def, dblvl, gf, repair = false, false, false, false
    local dres, tres = false, false
	local goodmod = false
	--local fshield, nvshield = false, false

	 --Threshholds for Resists
	 dres = hasRes(item, 26, 2) --2 Single resists of 26-30%
     tres = hasRes(item, 20, 3)  --3 Single resists of 20-30%


	if hasRes(item, 25, 3) then -- keep ALL w/25-30% to 3+ res (rare)
		return true
	end
	
	if hasRes(item, 10, 4) then -- keep ALL w/10-30% Allres (VERY rare)
		return true
	end


	for i = 0, item.mods:size() - 1 do
		if item.mods[i].Stat.Type == StatType.FasterHitRecovery then
				if item.mods[i].Value == 24 then -- 24fhr->goodmod
					goodmod = true
				elseif item.mods[i].Value >= 10 then -- 10-17fhr->fhr
					fhr = true
				end
		elseif item.mods[i].Stat.Type == StatType.Strength then
				if item.mods[i].Value >= 25 then -- 25-30Str->goodmod
					goodmod = true
				elseif item.mods[i].Value >= 12 then -- 12-19Str->str
					str = true
				end
		elseif item.mods[i].Stat.Type == StatType.MaxLife then
				if item.mods[i].Value >= 50 then -- 50-60Life->goodmod
					goodmod = true
				elseif item.mods[i].Value >= 20 then -- 20-49Life->life
					life = true
				end
		elseif item.mods[i].Stat.Type == StatType.DefensePercent then
				if item.mods[i].Value >= 150 then -- 150-200%Def->goodmod
					goodmod = true
				elseif item.mods[i].Value >= 66 then -- 66-149%Def->def
					def = true
				end
		elseif item.mods[i].Stat.Type == StatType.ArmorPerLevel then -- +4def/lvl (Faithful)
			   		dblvl = true
		elseif item.mods[i].Stat.Type == StatType.GoldFind and
			   item.mods[i].Value >= 75 then -- 75-80%Goldfind->gf
					gf = true
		elseif  (item.mods[i].Stat.Type == StatType.ReplenishDurability and
            	item.flags.Ethereal) then  --Eth + Repair(Self-Repair/Restoration)
					repair = true
					goodmod = true
		elseif (item.mods[i].Stat.Type == StatType.LifeRegen and
				item.mods[i].Value >=8) then -- 8-9 Life Regen
					regen = true
		end
	end

	return (           
		   (fhr and def and (str or life or regen or dres or tres or dblvl)) or --
		   (str and (def or life or dres or tres or dblvl)) or --16-30str + mod
           (def and (str or life or regen or dres or tres or dblvl)) or
		   (goodmod and (fhr or str or def or life or dres or  tres or dblvl or regen)) -- str, life, def near perfect
		   )
end

--[[

-- GOOD BELT AFFIXES --
--------------------------------------------------
--PREFIXES
--------------------------------------------------
--Faithful			+4 Defense per Level
--Saintly			66-80% Defense
--Holy				81% to +100% Defense
--Godly				101% to +200% Defense
--Lap/Rus/Och/Vir   Single Resist from 11-20%
--Cob/Gar/Cor/Jad	Single resist from 21-30%
--------------------------------------------------
--SUFFIXES
--------------------------------------------------
--of Balance 		10% FHR
--of Equilibrium 	17% FHR
--of Stability 		24% FHR
--of the Giant		10-15 Strength
--of the Titan		16-20 Strength
--of Atlas			21-30 Strength
--of the Mammoth	31-40 Life
--of the Colossus	41-60 Life
--of Wealth			41-80% Goldfind
--of Regeneration	3-5 Replenish Life
--of Regrowth	    6-9 Replenish Life
--of Self-Repair	Repair 1 Dur in 33 Seconds
--of Restoration	Repair 1 Dur in 20 Seconds
--of Frost Shield	5% ctc Lvl3 Frost Nova when struck
--of Nova Shield	14% ctc Lvl5 Nova when struck

]]--